<template>
  <typeBase>
    <template v-slot:main-left>
      <Institution />
    </template>
    <template v-slot:main-button>
      <mainButton
        @toMainSearch="search"
        @toMainSearchReset="reset"
        :main-button="mainButton"
      />
    </template>
    <template v-slot:table-main>
      <common-table
        :data="infoList"
        border
        :columns-item="columns"
        :title="infoTitle"
        :loading="false"
        @checkbox-change="selectChangeEvent"
      />
    </template>
  </typeBase>
</template>

<script>
import typeBase from "@/components/Layout/typeBase.vue"
import Institution from "@/components/Trees/Institution.vue"
import mainButton from "@/components/CommonButtons/MainButton.vue"
import searchMain from "@/components/CommonForm/index.vue"
import CommonTable from "@/components/CommonTable/index.vue"
// 加载模拟数据
import {
  infoList,
  sexs,
  fileStatusType,
  changeType,
  changeState,
  addressList,
  information,
  isSignType,
  familyInformation,
  complete,
  peopleSigns,
  publicSigns,
  dataProps
} from "@/simdata/healthData.js"
export default {
  components: {
    typeBase,
    Institution,
    mainButton,
    searchMain,
    CommonTable
  },
  data() {
    return {
      // 配置常用按钮
      mainButton: [
        {
          label: "档案合并",
          icon: "el-icon-circle-plus-outline",
          type: "primary",
          handle: () => {}
        },
        {
          label: "档案状态变更",
          icon: "el-icon-edit-outline",
          type: "success",
          handle: () => {
            console.log("点击了")
          }
        }
      ],
      // 所有列表数据
      infoTitle: "卫生巡视登记详情列表",
      infoList: infoList,
      // 配置显示的label标签
      columns: [
        { prop: "type", label: "巡查类别", width: "100" },
        { prop: "name", label: "巡查人", width: "100" },
        { prop: "organ", label: "巡查机构", width: "180" },
        { prop: "inspectionDate", label: "巡查日期", width: "100" },
        { prop: "createDate", label: "录入日期", width: "100" },
        { prop: "address", label: "巡查地点入内容", width: "180" },
        { prop: "problem", label: "发现的主要问题", width: "180" },
        { prop: "handle", label: "处理历史", width: "180" },
        { prop: "remarks", label: "备注", width: "180" },
        { prop: "files", label: "附件", width: "150" }
      ]
    }
  },
  methods: {
    // 点击搜索按钮
    search() {},
    // 点击重置按钮
    reset() {},
    // 点击搜索按钮，请求数据
    callbackComponent() {
      console.log("调接口")
    },
    // 人员基本信息复选框勾选
    // 家庭基本信息复选框选中
    selectChangeEvent({ checked, records }) {}
  }
}
</script>
<style lang="scss" scoped></style>
